package com.itheima.module.dao;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class StaticFactoryUtil {

    //使用别人的工具
    public static SqlSessionFactory sqlSessionFactory(){

        SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();
        SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(App.class.getClassLoader().getResourceAsStream("SqlMapConfig.xml"));

        return sqlSessionFactory;

    }
}
